package com.example.backend.config;

import com.example.backend.filter.AdminFilter;
import com.example.backend.filter.JWTFilter;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @Author Jcy
 * @Date 2022/5/6
 */

@Configuration
public class AdminConfig implements WebMvcConfigurer {
    @Resource
    private AdminFilter adminfilter;

    @Override
    public void addInterceptors(InterceptorRegistry registry){
        registry.addInterceptor(adminfilter).addPathPatterns("/v1/admin/**");
    }
}
